package org.hyh.core;

import java.util.Calendar;

/**
 * @auther :hyh
 * @desc :
 * @date :2019/11/28
 */
public class abc {
	public static void main(String[] args) {
		Calendar ainstance = Calendar.getInstance();
		ainstance.add(Calendar.DAY_OF_YEAR,3);
		int i = ainstance.get(Calendar.DAY_OF_WEEK);
          //  7 是星期6，1 是星期天。
		System.out.println(i);

		System.out.println(ainstance.get(Calendar.YEAR));

		System.out.println(Math.ceil(5 / 2));
		int a = (int) Math.ceil(5 / 2);
		System.out.println(a);
		System.out.println(System.currentTimeMillis());
		System.out.println("------------------------------");
		Calendar instance = Calendar.getInstance();
		int year = instance.get(Calendar.YEAR);
		int month = instance.get(Calendar.MONTH)+1;
//        int days = instance.get(Calendar.DAY_OF_MONTH);
		long millis = System.currentTimeMillis();
		System.out.println(millis);
		String yearStr = String.valueOf(year).substring(2);
		System.out.println(yearStr);
		String monthStr = month < 10 ? "0" + month : String.valueOf(month);
		System.out.println(monthStr);
		String value = String.valueOf(millis);
		String valueStr = value.substring(value.length() - 6);
		System.out.println(yearStr +monthStr+valueStr);
	}
}
